# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-voluptuous
_pkgname=voluptuous
pkgver=0.13.1
pkgrel=0
pkgdesc="Python data validation library"
url="https://github.com/alecthomas/voluptuous"
license="BSD-3-Clause"
arch="noarch"
depends="python3"
makedepends="py3-setuptools"
checkdepends="py3-pytest"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

replaces="py-voluptuous" # Backwards compatibility
provides="py-voluptuous=$pkgver-r$pkgrel" # Backwards compatibility

prepare() {
	default_prepare
	# https://github.com/alecthomas/voluptuous/issues/333
	rm -rf ./*.egg-info
}

build() {
	python3 setup.py build
}

check() {
	python3 -m pytest voluptuous/tests/tests.py
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="
c81867ee9f95d7104a5491b35d3fe050250f80b46b2633ce72996aba32b33d043ad5ca36b6c03cd12284db2962d551b1fb0fd82682f8740a01742b907bb692cf  voluptuous-0.13.1.tar.gz
"
